home *** CD-ROM | disk | FTP | other *** search
/ Creative Computers / Creative Computers CD-ROM, Volume 1 (Legendary Design Technologies, Inc.)(1994).iso / text / info / ansi_color < prev    next >
Text File  |  1994-11-17  |  4KB  |  151 lines

  1.  
  2.      ANSI Colour in Messages
  3.      ~~~~~~~~~~~~~~~~~~~~~~~
  4. =============================================================================
  5.  
  6.      It seems there are several people interested in knowing how to insert
  7. colour into their messages, so....
  8.  
  9.  
  10. ANSI COLOUR:
  11.  
  12. ANSI (American National Standards Institute) colour is a neat way to spritz
  13. up your messages.  It usually allows up to 8 colours (depends on your term)
  14. as well as boldface, underline, italics and inverse.  It's also got a
  15. practical aspect to it, since you can use it emphasize points or words.
  16.  
  17. This particular method of inserting colour/style only works on certain BBS
  18. programs, namely PCBoard (any version) and FoReM (any version).  I have
  19. attempted it on several other BBS programs (BBS-PC, Opus, FCP, etc) to no
  20. avail, but if anyone manages to get it working, give me a shout!
  21.  
  22. Now, on with it....
  23.  
  24.  
  25. The colour in messages is controlled by escape sequences (they start with
  26. the escape code), and takes up line room.  This means that while you won't
  27. see the sequence, it will count in your "number of characters per line",
  28. and it's likely that if you use a lot of codes on the same line that it
  29. will wrap over to the next line fairly soon. Be Warned!
  30.  
  31. The format of the colour/style sequence is as follows:
  32.  
  33. -----
  34.  
  35. ESC[s;ff;bb;m
  36.  
  37. -----
  38.  
  39. ESC   is the ESCAPE key.
  40. [     is the left square bracket
  41. s     is the STYLE number
  42. ;     is a semi-colon
  43. ff    is the FOREGROUND (letter) colour
  44. bb    is the BACKGROUND colour
  45. m     is the letter "m" and is the terminator, signifies end of code
  46.  
  47.  
  48. You're probably wondering what all these numbers are.  So...
  49.  
  50.  
  51. STYLE NUMBERS:
  52.  
  53.   0  - Plain Text
  54.   1  - Bold Face
  55.   3  - Italic
  56.   4  - Underline
  57.   7  - Inverse
  58.  
  59. FOREGROUND NUMBERS:
  60.  
  61.   30 - Colour 1 (background colour)
  62.   31 -  "  "  2 (standard text colour)
  63.   32 -  "  "  3
  64.   33 -  "  "  4
  65.   34 -  "  "  5
  66.   35 -  "  "  6
  67.   36 -  "  "  7
  68.   37 -  "  "  8
  69.  
  70. BACKGROUND NUMBERS:
  71.  
  72.   40 - Colour 1 (background colour )
  73.   41 -  "  "  2 (standard text colour)
  74.   42 -  "  "  3
  75.   43 -  "  "  4
  76.   44 -  "  "  5
  77.   45 -  "  "  6
  78.   46 -  "  "  7
  79.   47 -  "  "  8
  80.  
  81.  
  82. The colours you'll be seeing will depend one your setup.  If you use
  83. Online!, the colours are set and you can't change them (short of hacking
  84. Online, something not recommended ;-).  Terms like AZcomm use only 4
  85. colours, and those are controlled by your WB/Preferences colours.  The best
  86. terms for this application are the ones that allow you to change the colour
  87. palette, such as GT or Access!.
  88.  
  89. NOTE:  I have experianced some trouble with ESCAPE on Online! 2.11, am
  90.        working on it and will get info shortly..
  91.  
  92. When you type the sequence in, you won't see it echo on your screen.  After
  93. terminating it with an "m", continue typing your msg and you should see the
  94. new colour/style.  To revert back to normal colour/style, type in the
  95. escape sequence:
  96.  
  97. -----
  98.  
  99. ESC[0m
  100.  
  101. -----
  102.  
  103. That resets everything back to normal.  ALWAYS USE THIS BEFORE YOU END A
  104. MESSAGE, or you'll leave the reader in that particular colour/style for all
  105. his text!
  106.  
  107. ** NOTE ** - NEVER use the background colour and not reset it.  This makes
  108.              all the text after it INVISIBLE, and is an extremely rude
  109.              thing to do to someone.
  110.  
  111.  
  112. If you only want to change the style, or only the foreground (letter)
  113. colour, or only the background, or any other combos, it is not necessary to
  114. include all 3 numbers.  If you just want one of the 3, then it would go
  115. something like:
  116.  
  117. -----
  118.  
  119. ESC[xxm
  120.  
  121. -----
  122.  
  123. xx    is any one of the numbers (style, foreground or background)
  124. m     is the terminator
  125.  
  126.  
  127.  
  128. Here are some examples of colour/style changes, to help you out:
  129.  
  130.  
  131. ESC[3;34;42m         - This will turn on ITALICS, change the letter colour
  132.                        to the 5th colour and change the background colour
  133.                        to the 3rd colour.
  134.  
  135. ESC[4;32m            - This will turn on UNDERLINE and change the letter
  136.                        colour to the 3rd colour.
  137.  
  138. ESC[1;43m            - This will turn on BOLDFACE and change the background
  139.                        colour to the 4th colour.
  140.  
  141. ESC[36m              - This will change the letter colour to the 7th color.
  142.  
  143. ESC[7m               - This will turn on INVERSE.
  144.  
  145. ESC[0m               - This will turn everything back to normal.
  146.  
  147.  
  148. Hope this has helped SOMEONE!
  149.  
  150.  
  151.